﻿using KelonProud.BackgroundJobs.Jobs.Base;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;

namespace KelonProud.BackgroundJobs.Jobs.kunnancanjiren
{
    //2.3.3.1	困难残疾人信息
    public class DifficultPersonInfoJob : DataJobBase
    {
        private readonly DateTime _beginTime = DateTime.Now.AddDays(-40);

        //执行时间表达式，每天十二点执行
        public override string CronExpression => "38 * * * *";

        //请求路径
        protected override string RequestPath => "xzsp/insuranceApi/difficultPersonInfo.do";

        protected override Dictionary<string, string> Fields =>new Dictionary<string, string>()
        {
            { "filed1","Date"}
        };

        protected override string TableName => "difficultPersonInfo";

        public override void Execute()
        {
            var apiPath = GetRequestFullPath(_beginTime, DateTime.Now);

            var result = PostData(apiPath);

            var datas = ResolveData(result.List);

            ExecuteImportTemp(datas);

            ExecuteTempToTable();
        }
    }
}
